package us.icitap.cm.business.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.eclipse.persistence.annotations.Customizer;

import us.icitap.cm.utils.MyCustomizer;

@Entity
@Customizer(MyCustomizer.class)
@Table(name="CHARGE", schema="MPC")
@IdClass(ChargeId.class)
public class Charge implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3325676526611385000L;

	@Id
	private Integer id;
	
	@Id
	@Column(name="PERSON_ID", insertable=false, updatable=false)
	private Integer personId;
	
	
	@Column(name="DECISION_NO", length=10)
	private String decisionNo;
	
	@Temporal(TemporalType.DATE)
	@Column(name="DECISION_DATE")
	private Date decisionDate;
	
	@OneToMany(mappedBy="charge")
	private List<Penalty> penaltyList;
	
	@OneToMany(mappedBy="charge")
	private List<MedicalEducationalMeasure> medEduMeasureList;
	
	@Column(name="COURT_STRUCTURE", length=150)
	private String courtStructure;
	
	@ManyToOne
	@JoinColumn(name="PERSON_ID")
	private Person person;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getPersonId() {
		return personId;
	}

	public void setPersonId(Integer personId) {
		this.personId = personId;
	}

	public String getDecisionNo() {
		return decisionNo;
	}

	public void setDecisionNo(String decisionNo) {
		this.decisionNo = decisionNo;
	}

	public Date getDecisionDate() {
		return decisionDate;
	}

	public void setDecisionDate(Date decisionDate) {
		this.decisionDate = decisionDate;
	}

	public List<Penalty> getPenaltyList() {
		return penaltyList;
	}

	public void setPenaltyList(List<Penalty> penaltyList) {
		this.penaltyList = penaltyList;
	}

	public List<MedicalEducationalMeasure> getMedEduMeasureList() {
		return medEduMeasureList;
	}

	public void setMedEduMeasureList(
			List<MedicalEducationalMeasure> medEduMeasureList) {
		this.medEduMeasureList = medEduMeasureList;
	}

	public String getCourtStructure() {
		return courtStructure;
	}

	public void setCourtStructure(String courtStructure) {
		this.courtStructure = courtStructure;
	}

	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}
	
	
}
